from django.db import models
from utils import choices

# Create your models here.
class Project(models.Model):
    account_id = models.IntegerField(
        verbose_name='用户ID',
    )

    programming_language = models.CharField(
        verbose_name='语言类型',
        max_length=40,
        blank=True
    )

    project_name=models.CharField(
        verbose_name='项目名称',
        max_length=60,
        blank=True,
    )

    received=models.NullBooleanField(
        verbose_name='拷贝完成',
        default=False,
    )

    ti_id = models.IntegerField(
        verbose_name='题目ID',
        blank=True,
        default=-1,
    )

    submited = models.NullBooleanField(
        verbose_name='已提交',
        default=False,
        blank=True,
        null=True,
    )

    compile_successed = models.NullBooleanField(
        verbose_name='已编译成功',
        default=False,
        blank=True,
        null=True,
    )

    status = models.CharField(
        verbose_name='项目状态',
        max_length=20,
        choices=choices.PEOJECT_STATUS,
        default='1',
    )


class ProjectDetail(models.Model):
    project_id = models.IntegerField(
        verbose_name='项目ID',
    )

    file_name=models.CharField(
        verbose_name='文件名',
        max_length=60,
        null=True
    )

    code=models.TextField(
        verbose_name='代码',
        max_length=4000,
        null=True
    )
